Localize profile badge + fix badges applying while plugin disabled#1
Open
TomFront wants to merge 1 commit into
Open
Localize profile badge + fix badges applying while plugin disabled#1TomFront wants to merge 1 commit into
TomFront wants to merge 1 commit into
Conversation
- Add per-locale labels for the Partnered Server Owner profile badge via LocaleStore, covering Discord's supported languages with English fallback (en-US/en-GB/fr confirmed, the rest best-effort). - Gate all injection behind an `enabled` flag so the settings panel can no longer inject while the plugin is toggled off. - On stop(), fully undo injections across every surface (header, server-profile card, invite embed, profile badge) via removeAllInjections(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Two changes in
ServerBadges/index.tsx:1. Localized the "Partnered Server Owner" profile badge tooltip.
Discord localizes this string server-side for real badges, so the client doesn't ship it. Added a per-locale label map keyed on
LocaleStore.locale(exact locale -> language prefix -> English fallback), re-rendering on locale change.en-US,en-GB, andfrare confirmed as Discord's exact wording; the remaining ~28 locales are best-effort translations (flagged in-code) that may differ slightly from Discord's official phrasing.2. Fixed badges applying while the plugin is toggled off.
The settings panel runs even when the plugin is disabled, and changing a dropdown called the injection directly - so the server badge could be set/persist with the plugin off, inconsistent with the profile badge. All injection is now gated behind an
enabledflag that onlystart()/stop()control, andstop()now fully undoes every surface (header/GuildStore, server-profile card/GuildProfileStore, invite embed/InviteStore, profile badge) via a newremoveAllInjections()- previously it only cleaned the header + profile badge.Reviewer notes
GUILD_UPDATEdispatch by design). Switching channels clears it.🤖 Generated with Claude Code